<template>
    <view class="columnbox wdh-100 content">
        <view @click="showDetail(item)" v-for="(item,index) in List" :key='index' class="columnbox one-info">
            <view class="top-box rowbox spb wdh-100">
                <view>{{item.doctor}}医生开</view>
                <view class="addtime">{{item.addtime}}</view>
            </view>
            <view class="wdh-100 rowbox jus zd-title">诊断：<view>{{item.zhenduan}}</view>
            </view>
        </view>
    </view>
</template>

<script>
    import getdate from '@/utils/time.js'
    export default {
        data() {
            return {
                List: []
            };
        },
        computed: {
            userInfo() {
                return this.$store.state.user;
            },
        },
        onLoad() {
            console.log(this.userInfo)
            this.getList()
        },
        methods: {
            getList() {
                this.$req.post('/user/binglis', {
                    userid: this.userInfo.id
                }).then(res => {
                    res.data.data.forEach(resp => {
                        resp.addtime = getdate.toLocalDate(resp.addtime)
                    })
                    this.List = res.data.data
                })
            },
            showDetail(v) {
                uni.navigateTo({
                    url: '/pages/bingli/detail?id=' + v.id
                })
            },
        }
    }
</script>

<style lang="scss" scoped>
    .content {
        min-height: 100vh;
        background: #F5F8FB;
        justify-content: flex-start;
        font-family: PingFang SC;
    }

    .one-info {
        width: 710rpx;
        border-radius: 10rpx;
        padding: 32rpx 32rpx;
        background: #fff;
        margin: 10rpx 0;
    }

    .top-box {
        font-size: 28rpx;
        padding-bottom: 20rpx;
        border-bottom: #f3f7fa solid 1px;
        font-weight: bold;
    }

    .addtime {
        font-weight: normal;
        color: #9f9199;
    }

    .zd-title {
        font-size: 28rpx;
        margin-top: 20rpx;

        view {
            width: 550rpx;
            text-align: left;
        }
    }
</style>